<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title>Service UI Fragment</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag"/>
</head>

<body>
<main role="main" class="container mt-3 mb-3">
    <div th:fragment="recaptchaToken">
        <span th:if="${recaptchaVersion=='v2'}" th:remove="tag">
            <section class="form-group" th:if="${recaptchaSiteKey != null AND recaptchaInvisible != null AND !recaptchaInvisible}">
                <div class="g-recaptcha" th:attr="data-sitekey=${recaptchaSiteKey}"/>

                <script type="text/javascript"
                        th:if="${recaptchaSiteKey != null AND recaptchaInvisible != null AND recaptchaInvisible}"
                        th:inline="javascript">
                    function onRecaptchaV2Submit(token) {
                        document.getElementById('fm1').submit();
                    }
                </script>

            </section>
        </span>
        <span th:if="${recaptchaVersion=='v3'}" th:remove="tag">
            <input type="hidden" id="g-recaptcha-token" name="g-recaptcha-token"/>

            <script type="text/javascript" th:if="${recaptchaSiteKey != null}" th:inline="javascript">
                grecaptcha.ready(function () {
                    grecaptcha.execute(/*[[${recaptchaSiteKey}]]*/, { action: 'login' })
                        .then(function (token) {
                            $('#g-recaptcha-token').val(token);
                        });
                });
            </script>
        </span>
    </div>
</main>
</body>

</html>



